home *** CD-ROM | disk | FTP | other *** search
/ Openstep 4.2 (Developer) / Openstep Developer 4.2.iso / NextDeveloper / Source / GNU / make / make-3.74 / make.info-7 < prev    next >
Encoding:
GNU Info File  |  1995-08-01  |  26.1 KB  |  728 lines

  1. This is Info file make.info, produced by Makeinfo-1.55 from the input
  2. file ./make.texinfo.
  3.  
  4.    This file documents the GNU Make utility, which determines
  5. automatically which pieces of a large program need to be recompiled,
  6. and issues the commands to recompile them.
  7.  
  8.    This is Edition 0.48, last updated 4 April 1995, of `The GNU Make
  9. Manual', for `make', Version 3.73 Beta.
  10.  
  11.    Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95     Free
  12. Software Foundation, Inc.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of this
  15. manual provided the copyright notice and this permission notice are
  16. preserved on all copies.
  17.  
  18.    Permission is granted to copy and distribute modified versions of
  19. this manual under the conditions for verbatim copying, provided that
  20. the entire resulting derived work is distributed under the terms of a
  21. permission notice identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that this permission notice may be stated in a
  26. translation approved by the Free Software Foundation.
  27.  
  28. 
  29. File: make.info,  Node: Directory Variables,  Prev: Command Variables,  Up: Makefile Conventions
  30.  
  31. Variables for Installation Directories
  32. ======================================
  33.  
  34.    Installation directories should always be named by variables, so it
  35. is easy to install in a nonstandard place.  The standard names for these
  36. variables are described below.  They are based on a standard filesystem
  37. layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and
  38. other modern operating systems.
  39.  
  40.    These two variables set the root for the installation.  All the other
  41. installation directories should be subdirectories of one of these two,
  42. and nothing should be directly installed into these two directories.
  43.  
  44. `prefix'
  45.      A prefix used in constructing the default values of the variables
  46.      listed below.  The default value of `prefix' should be `/usr/local'
  47.      When building the complete GNU system, the prefix will be empty and
  48.      `/usr' will be a symbolic link to `/'.
  49.  
  50. `exec_prefix'
  51.      A prefix used in constructing the default values of some of the
  52.      variables listed below.  The default value of `exec_prefix' should
  53.      be `$(prefix)'.
  54.  
  55.      Generally, `$(exec_prefix)' is used for directories that contain
  56.      machine-specific files (such as executables and subroutine
  57.      libraries), while `$(prefix)' is used directly for other
  58.      directories.
  59.  
  60.    Executable programs are installed in one of the following
  61. directories.
  62.  
  63. `bindir'
  64.      The directory for installing executable programs that users can
  65.      run.  This should normally be `/usr/local/bin', but write it as
  66.      `$(exec_prefix)/bin'.
  67.  
  68. `sbindir'
  69.      The directory for installing executable programs that can be run
  70.      from the shell, but are only generally useful to system
  71.      administrators.  This should normally be `/usr/local/sbin', but
  72.      write it as `$(exec_prefix)/sbin'.
  73.  
  74. `libexecdir'
  75.      The directory for installing executable programs to be run by other
  76.      programs rather than by users.  This directory should normally be
  77.      `/usr/local/libexec', but write it as `$(exec_prefix)/libexec'.
  78.  
  79.    Data files used by the program during its execution are divided into
  80. categories in two ways.
  81.  
  82.    * Some files are normally modified by programs; others are never
  83.      normally modified (though users may edit some of these).
  84.  
  85.    * Some files are architecture-independent and can be shared by all
  86.      machines at a site; some are architecture-dependent and can be
  87.      shared only by machines of the same kind and operating system;
  88.      others may never be shared between two machines.
  89.  
  90.    This makes for six different possibilities.  However, we want to
  91. discourage the use of architecture-dependent files, aside from of object
  92. files and libraries.  It is much cleaner to make other data files
  93. architecture-independent, and it is generally not hard.
  94.  
  95.    Therefore, here are the variables makefiles should use to specify
  96. directories:
  97.  
  98. `datadir'
  99.      The directory for installing read-only architecture independent
  100.      data files.  This should normally be `/usr/local/share', but write
  101.      it as `$(prefix)/share'.  As a special exception, see `$(infodir)'
  102.      and `$(includedir)' below.
  103.  
  104. `sysconfdir'
  105.      The directory for installing read-only data files that pertain to a
  106.      single machine-that is to say, files for configuring a host.
  107.      Mailer and network configuration files, `/etc/passwd', and so
  108.      forth belong here.  All the files in this directory should be
  109.      ordinary ASCII text files.  This directory should normally be
  110.      `/usr/local/etc', but write it as `$(prefix)/etc'.
  111.  
  112.      Do not install executables in this directory (they probably belong
  113.      in `$(libexecdir)' or `$(sbindir))'.  Also do not install files
  114.      that are modified in the normal course of their use (programs
  115.      whose purpose is to change the configuration of the system
  116.      excluded).  Those probably belong in `$(localstatedir)'.
  117.  
  118. `sharedstatedir'
  119.      The directory for installing architecture-independent data files
  120.      which the programs modify while they run.  This should normally be
  121.      `/usr/local/com', but write it as `$(prefix)/com'.
  122.  
  123. `localstatedir'
  124.      The directory for installing data files which the programs modify
  125.      while they run, and that pertain to one specific machine.  Users
  126.      should never need to modify files in this directory to configure
  127.      the package's operation; put such configuration information in
  128.      separate files that go in `datadir' or `$(sysconfdir)'.
  129.      `$(localstatedir)' should normally be `/usr/local/var', but write
  130.      it as `$(prefix)/var'.
  131.  
  132. `libdir'
  133.      The directory for object files and libraries of object code.  Do
  134.      not install executables here, they probably belong in
  135.      `$(libexecdir)' instead.  The value of `libdir' should normally be
  136.      `/usr/local/lib', but write it as `$(exec_prefix)/lib'.
  137.  
  138. `infodir'
  139.      The directory for installing the Info files for this package.  By
  140.      default, it should be `/usr/local/info', but it should be written
  141.      as `$(prefix)/info'.
  142.  
  143. `includedir'
  144.      The directory for installing header files to be included by user
  145.      programs with the C `#include' preprocessor directive.  This
  146.      should normally be `/usr/local/include', but write it as
  147.      `$(prefix)/include'.
  148.  
  149.      Most compilers other than GCC do not look for header files in
  150.      `/usr/local/include'.  So installing the header files this way is
  151.      only useful with GCC.  Sometimes this is not a problem because some
  152.      libraries are only really intended to work with GCC.  But some
  153.      libraries are intended to work with other compilers.  They should
  154.      install their header files in two places, one specified by
  155.      `includedir' and one specified by `oldincludedir'.
  156.  
  157. `oldincludedir'
  158.      The directory for installing `#include' header files for use with
  159.      compilers other than GCC.  This should normally be `/usr/include'.
  160.  
  161.      The Makefile commands should check whether the value of
  162.      `oldincludedir' is empty.  If it is, they should not try to use
  163.      it; they should cancel the second installation of the header files.
  164.  
  165.      A package should not replace an existing header in this directory
  166.      unless the header came from the same package.  Thus, if your Foo
  167.      package provides a header file `foo.h', then it should install the
  168.      header file in the `oldincludedir' directory if either (1) there
  169.      is no `foo.h' there or (2) the `foo.h' that exists came from the
  170.      Foo package.
  171.  
  172.      To tell whether `foo.h' came from the Foo package, put a magic
  173.      string in the file--part of a comment--and grep for that string.
  174.  
  175.    Unix-style man pages are installed in one of the following:
  176.  
  177. `mandir'
  178.      The directory for installing the man pages (if any) for this
  179.      package.  It should include the suffix for the proper section of
  180.      the manual--usually `1' for a utility.  It will normally be
  181.      `/usr/local/man/man1', but you should write it as
  182.      `$(prefix)/man/man1'.
  183.  
  184. `man1dir'
  185.      The directory for installing section 1 man pages.
  186.  
  187. `man2dir'
  188.      The directory for installing section 2 man pages.
  189.  
  190. `...'
  191.      Use these names instead of `mandir' if the package needs to
  192.      install man pages in more than one section of the manual.
  193.  
  194.      *Don't make the primary documentation for any GNU software be a
  195.      man page.  Write a manual in Texinfo instead.  Man pages are just
  196.      for the sake of people running GNU software on Unix, which is a
  197.      secondary application only.*
  198.  
  199. `manext'
  200.      The file name extension for the installed man page.  This should
  201.      contain a period followed by the appropriate digit; it should
  202.      normally be `.1'.
  203.  
  204. `man1ext'
  205.      The file name extension for installed section 1 man pages.
  206.  
  207. `man2ext'
  208.      The file name extension for installed section 2 man pages.
  209.  
  210. `...'
  211.      Use these names instead of `manext' if the package needs to
  212.      install man pages in more than one section of the manual.
  213.  
  214.    And finally, you should set the following variable:
  215.  
  216. `srcdir'
  217.      The directory for the sources being compiled.  The value of this
  218.      variable is normally inserted by the `configure' shell script.
  219.  
  220.    For example:
  221.  
  222.      # Common prefix for installation directories.
  223.      # NOTE: This directory must exist when you start the install.
  224.      prefix = /usr/local
  225.      exec_prefix = $(prefix)
  226.      # Where to put the executable for the command `gcc'.
  227.      bindir = $(exec_prefix)/bin
  228.      # Where to put the directories used by the compiler.
  229.      libexecdir = $(exec_prefix)/libexec
  230.      # Where to put the Info files.
  231.      infodir = $(prefix)/info
  232.  
  233.    If your program installs a large number of files into one of the
  234. standard user-specified directories, it might be useful to group them
  235. into a subdirectory particular to that program.  If you do this, you
  236. should write the `install' rule to create these subdirectories.
  237.  
  238.    Do not expect the user to include the subdirectory name in the value
  239. of any of the variables listed above.  The idea of having a uniform set
  240. of variable names for installation directories is to enable the user to
  241. specify the exact same values for several different GNU packages.  In
  242. order for this to be useful, all the packages must be designed so that
  243. they will work sensibly when the user does so.
  244.  
  245. 
  246. File: make.info,  Node: Quick Reference,  Next: Complex Makefile,  Prev: Makefile Conventions,  Up: Top
  247.  
  248. Quick Reference
  249. ***************
  250.  
  251.    This appendix summarizes the directives, text manipulation functions,
  252. and special variables which GNU `make' understands.  *Note Special
  253. Targets::, *Note Catalogue of Implicit Rules: Catalogue of Rules, and
  254. *Note Summary of Options: Options Summary, for other summaries.
  255.  
  256.    Here is a summary of the directives GNU `make' recognizes:
  257.  
  258. `define VARIABLE'
  259. `endef'
  260.      Define a multi-line, recursively-expanded variable.
  261.      *Note Sequences::.
  262.  
  263. `ifdef VARIABLE'
  264. `ifndef VARIABLE'
  265. `ifeq (A,B)'
  266. `ifeq "A" "B"'
  267. `ifeq 'A' 'B''
  268. `ifneq (A,B)'
  269. `ifneq "A" "B"'
  270. `ifneq 'A' 'B''
  271. `else'
  272. `endif'
  273.      Conditionally evaluate part of the makefile.
  274.      *Note Conditionals::.
  275.  
  276. `include FILE'
  277.      Include another makefile.
  278.      *Note Including Other Makefiles: Include.
  279.  
  280. `override VARIABLE = VALUE'
  281. `override VARIABLE := VALUE'
  282. `override VARIABLE += VALUE'
  283. `override define VARIABLE'
  284. `endef'
  285.      Define a variable, overriding any previous definition, even one
  286.      from the command line.
  287.      *Note The `override' Directive: Override Directive.
  288.  
  289. `export'
  290.      Tell `make' to export all variables to child processes by default.
  291.      *Note Communicating Variables to a Sub-`make': Variables/Recursion.
  292.  
  293. `export VARIABLE'
  294. `export VARIABLE = VALUE'
  295. `export VARIABLE := VALUE'
  296. `export VARIABLE += VALUE'
  297. `unexport VARIABLE'
  298.      Tell `make' whether or not to export a particular variable to child
  299.      processes.
  300.      *Note Communicating Variables to a Sub-`make': Variables/Recursion.
  301.  
  302. `vpath PATTERN PATH'
  303.      Specify a search path for files matching a `%' pattern.
  304.      *Note The `vpath' Directive: Selective Search.
  305.  
  306. `vpath PATTERN'
  307.      Remove all search paths previously specified for PATTERN.
  308.  
  309. `vpath'
  310.      Remove all search paths previously specified in any `vpath'
  311.      directive.
  312.  
  313.    Here is a summary of the text manipulation functions (*note
  314. Functions::.):
  315.  
  316. `$(subst FROM,TO,TEXT)'
  317.      Replace FROM with TO in TEXT.
  318.      *Note Functions for String Substitution and Analysis: Text
  319.      Functions.
  320.  
  321. `$(patsubst PATTERN,REPLACEMENT,TEXT)'
  322.      Replace words matching PATTERN with REPLACEMENT in TEXT.
  323.      *Note Functions for String Substitution and Analysis: Text
  324.      Functions.
  325.  
  326. `$(strip STRING)'
  327.      Remove excess whitespace characters from STRING.
  328.      *Note Functions for String Substitution and Analysis: Text
  329.      Functions.
  330.  
  331. `$(findstring FIND,TEXT)'
  332.      Locate FIND in TEXT.
  333.      *Note Functions for String Substitution and Analysis: Text
  334.      Functions.
  335.  
  336. `$(filter PATTERN...,TEXT)'
  337.      Select words in TEXT that match one of the PATTERN words.
  338.      *Note Functions for String Substitution and Analysis: Text
  339.      Functions.
  340.  
  341. `$(filter-out PATTERN...,TEXT)'
  342.      Select words in TEXT that *do not* match any of the PATTERN words.
  343.      *Note Functions for String Substitution and Analysis: Text
  344.      Functions.
  345.  
  346. `$(sort LIST)'
  347.      Sort the words in LIST lexicographically, removing duplicates.
  348.      *Note Functions for String Substitution and Analysis: Text
  349.      Functions.
  350.  
  351. `$(dir NAMES...)'
  352.      Extract the directory part of each file name.
  353.      *Note Functions for File Names: Filename Functions.
  354.  
  355. `$(notdir NAMES...)'
  356.      Extract the non-directory part of each file name.
  357.      *Note Functions for File Names: Filename Functions.
  358.  
  359. `$(suffix NAMES...)'
  360.      Extract the suffix (the last `.' and following characters) of each
  361.      file name.
  362.      *Note Functions for File Names: Filename Functions.
  363.  
  364. `$(basename NAMES...)'
  365.      Extract the base name (name without suffix) of each file name.
  366.      *Note Functions for File Names: Filename Functions.
  367.  
  368. `$(addsuffix SUFFIX,NAMES...)'
  369.      Append SUFFIX to each word in NAMES.
  370.      *Note Functions for File Names: Filename Functions.
  371.  
  372. `$(addprefix PREFIX,NAMES...)'
  373.      Prepend PREFIX to each word in NAMES.
  374.      *Note Functions for File Names: Filename Functions.
  375.  
  376. `$(join LIST1,LIST2)'
  377.      Join two parallel lists of words.
  378.      *Note Functions for File Names: Filename Functions.
  379.  
  380. `$(word N,TEXT)'
  381.      Extract the Nth word (one-origin) of TEXT.
  382.      *Note Functions for File Names: Filename Functions.
  383.  
  384. `$(words TEXT)'
  385.      Count the number of words in TEXT.
  386.      *Note Functions for File Names: Filename Functions.
  387.  
  388. `$(firstword NAMES...)'
  389.      Extract the first word of NAMES.
  390.      *Note Functions for File Names: Filename Functions.
  391.  
  392. `$(wildcard PATTERN...)'
  393.      Find file names matching a shell file name pattern (*not* a `%'
  394.      pattern).
  395.      *Note The Function `wildcard': Wildcard Function.
  396.  
  397. `$(shell COMMAND)'
  398.      Execute a shell command and return its output.
  399.      *Note The `shell' Function: Shell Function.
  400.  
  401. `$(origin VARIABLE)'
  402.      Return a string describing how the `make' variable VARIABLE was
  403.      defined.
  404.      *Note The `origin' Function: Origin Function.
  405.  
  406. `$(foreach VAR,WORDS,TEXT)'
  407.      Evaluate TEXT with VAR bound to each word in WORDS, and
  408.      concatenate the results.
  409.      *Note The `foreach' Function: Foreach Function.
  410.  
  411.    Here is a summary of the automatic variables.  *Note Automatic
  412. Variables: Automatic, for full information.
  413.  
  414. `$@'
  415.      The file name of the target.
  416.  
  417. `$%'
  418.      The target member name, when the target is an archive member.
  419.  
  420. `$<'
  421.      The name of the first dependency.
  422.  
  423. `$?'
  424.      The names of all the dependencies that are newer than the target,
  425.      with spaces between them.  For dependencies which are archive
  426.      members, only the member named is used (*note Archives::.).
  427.  
  428. `$^'
  429. `$+'
  430.      The names of all the dependencies, with spaces between them.  For
  431.      dependencies which are archive members, only the member named is
  432.      used (*note Archives::.).  The value of `$^' omits duplicate
  433.      dependencies, while `$+' retains them and preserves their order.
  434.  
  435. `$*'
  436.      The stem with which an implicit rule matches (*note How Patterns
  437.      Match: Pattern Match.).
  438.  
  439. `$(@D)'
  440. `$(@F)'
  441.      The directory part and the file-within-directory part of `$@'.
  442.  
  443. `$(*D)'
  444. `$(*F)'
  445.      The directory part and the file-within-directory part of `$*'.
  446.  
  447. `$(%D)'
  448. `$(%F)'
  449.      The directory part and the file-within-directory part of `$%'.
  450.  
  451. `$(<D)'
  452. `$(<F)'
  453.      The directory part and the file-within-directory part of `$<'.
  454.  
  455. `$(^D)'
  456. `$(^F)'
  457.      The directory part and the file-within-directory part of `$^'.
  458.  
  459. `$(+D)'
  460. `$(+F)'
  461.      The directory part and the file-within-directory part of `$+'.
  462.  
  463. `$(?D)'
  464. `$(?F)'
  465.      The directory part and the file-within-directory part of `$?'.
  466.  
  467.    These variables are used specially by GNU `make':
  468.  
  469. `MAKEFILES'
  470.      Makefiles to be read on every invocation of `make'.
  471.      *Note The Variable `MAKEFILES': MAKEFILES Variable.
  472.  
  473. `VPATH'
  474.      Directory search path for files not found in the current directory.
  475.      *Note `VPATH' Search Path for All Dependencies: General Search.
  476.  
  477. `SHELL'
  478.      The name of the system default command interpreter, usually
  479.      `/bin/sh'.  You can set `SHELL' in the makefile to change the
  480.      shell used to run commands.  *Note Command Execution: Execution.
  481.  
  482. `MAKE'
  483.      The name with which `make' was invoked.  Using this variable in
  484.      commands has special meaning.  *Note How the `MAKE' Variable
  485.      Works: MAKE Variable.
  486.  
  487. `MAKELEVEL'
  488.      The number of levels of recursion (sub-`make's).
  489.      *Note Variables/Recursion::.
  490.  
  491. `MAKEFLAGS'
  492.      The flags given to `make'.  You can set this in the environment or
  493.      a makefile to set flags.
  494.      *Note Communicating Options to a Sub-`make': Options/Recursion.
  495.  
  496. `SUFFIXES'
  497.      The default list of suffixes before `make' reads any makefiles.
  498.  
  499. 
  500. File: make.info,  Node: Complex Makefile,  Next: Concept Index,  Prev: Quick Reference,  Up: Top
  501.  
  502. Complex Makefile Example
  503. ************************
  504.  
  505.    Here is the makefile for the GNU `tar' program.  This is a
  506. moderately complex makefile.
  507.  
  508.    Because it is the first target, the default goal is `all'.  An
  509. interesting feature of this makefile is that `testpad.h' is a source
  510. file automatically created by the `testpad' program, itself compiled
  511. from `testpad.c'.
  512.  
  513.    If you type `make' or `make all', then `make' creates the `tar'
  514. executable, the `rmt' daemon that provides remote tape access, and the
  515. `tar.info' Info file.
  516.  
  517.    If you type `make install', then `make' not only creates `tar',
  518. `rmt', and `tar.info', but also installs them.
  519.  
  520.    If you type `make clean', then `make' removes the `.o' files, and
  521. the `tar', `rmt', `testpad', `testpad.h', and `core' files.
  522.  
  523.    If you type `make distclean', then `make' not only removes the same
  524. files as does `make clean' but also the `TAGS', `Makefile', and
  525. `config.status' files.  (Although it is not evident, this makefile (and
  526. `config.status') is generated by the user with the `configure' program,
  527. which is provided in the `tar' distribution, but is not shown here.)
  528.  
  529.    If you type `make realclean', then `make' removes the same files as
  530. does `make distclean' and also removes the Info files generated from
  531. `tar.texinfo'.
  532.  
  533.    In addition, there are targets `shar' and `dist' that create
  534. distribution kits.
  535.  
  536.      # Generated automatically from Makefile.in by configure.
  537.      # Un*x Makefile for GNU tar program.
  538.      # Copyright (C) 1991 Free Software Foundation, Inc.
  539.      
  540.      # This program is free software; you can redistribute
  541.      # it and/or modify it under the terms of the GNU
  542.      # General Public License ...
  543.      ...
  544.      ...
  545.      
  546.      SHELL = /bin/sh
  547.      
  548.      #### Start of system configuration section. ####
  549.      
  550.      srcdir = .
  551.      
  552.      # If you use gcc, you should either run the
  553.      # fixincludes script that comes with it or else use
  554.      # gcc with the -traditional option.  Otherwise ioctl
  555.      # calls will be compiled incorrectly on some systems.
  556.      CC = gcc -O
  557.      YACC = bison -y
  558.      INSTALL = /usr/local/bin/install -c
  559.      INSTALLDATA = /usr/local/bin/install -c -m 644
  560.      
  561.      # Things you might add to DEFS:
  562.      # -DSTDC_HEADERS        If you have ANSI C headers and
  563.      #                       libraries.
  564.      # -DPOSIX               If you have POSIX.1 headers and
  565.      #                       libraries.
  566.      # -DBSD42               If you have sys/dir.h (unless
  567.      #                       you use -DPOSIX), sys/file.h,
  568.      #                       and st_blocks in `struct stat'.
  569.      # -DUSG                 If you have System V/ANSI C
  570.      #                       string and memory functions
  571.      #                       and headers, sys/sysmacros.h,
  572.      #                       fcntl.h, getcwd, no valloc,
  573.      #                       and ndir.h (unless
  574.      #                       you use -DDIRENT).
  575.      # -DNO_MEMORY_H         If USG or STDC_HEADERS but do not
  576.      #                       include memory.h.
  577.      # -DDIRENT              If USG and you have dirent.h
  578.      #                       instead of ndir.h.
  579.      # -DSIGTYPE=int         If your signal handlers
  580.      #                       return int, not void.
  581.      # -DNO_MTIO             If you lack sys/mtio.h
  582.      #                       (magtape ioctls).
  583.      # -DNO_REMOTE           If you do not have a remote shell
  584.      #                       or rexec.
  585.      # -DUSE_REXEC           To use rexec for remote tape
  586.      #                       operations instead of
  587.      #                       forking rsh or remsh.
  588.      # -DVPRINTF_MISSING     If you lack vprintf function
  589.      #                       (but have _doprnt).
  590.      # -DDOPRNT_MISSING      If you lack _doprnt function.
  591.      #                       Also need to define
  592.      #                       -DVPRINTF_MISSING.
  593.      # -DFTIME_MISSING       If you lack ftime system call.
  594.      # -DSTRSTR_MISSING      If you lack strstr function.
  595.      # -DVALLOC_MISSING      If you lack valloc function.
  596.      # -DMKDIR_MISSING       If you lack mkdir and
  597.      #                       rmdir system calls.
  598.      # -DRENAME_MISSING      If you lack rename system call.
  599.      # -DFTRUNCATE_MISSING   If you lack ftruncate
  600.      #                       system call.
  601.      # -DV7                  On Version 7 Unix (not
  602.      #                       tested in a long time).
  603.      # -DEMUL_OPEN3          If you lack a 3-argument version
  604.      #                       of open, and want to emulate it
  605.      #                       with system calls you do have.
  606.      # -DNO_OPEN3            If you lack the 3-argument open
  607.      #                       and want to disable the tar -k
  608.      #                       option instead of emulating open.
  609.      # -DXENIX               If you have sys/inode.h
  610.      #                       and need it 94 to be included.
  611.      
  612.      DEFS =  -DSIGTYPE=int -DDIRENT -DSTRSTR_MISSING \
  613.              -DVPRINTF_MISSING -DBSD42
  614.      # Set this to rtapelib.o unless you defined NO_REMOTE,
  615.      # in which case make it empty.
  616.      RTAPELIB = rtapelib.o
  617.      LIBS =
  618.      DEF_AR_FILE = /dev/rmt8
  619.      DEFBLOCKING = 20
  620.      
  621.      CDEBUG = -g
  622.      CFLAGS = $(CDEBUG) -I. -I$(srcdir) $(DEFS) \
  623.              -DDEF_AR_FILE=\"$(DEF_AR_FILE)\" \
  624.              -DDEFBLOCKING=$(DEFBLOCKING)
  625.      LDFLAGS = -g
  626.      
  627.      prefix = /usr/local
  628.      # Prefix for each installed program,
  629.      # normally empty or `g'.
  630.      binprefix =
  631.      
  632.      # The directory to install tar in.
  633.      bindir = $(prefix)/bin
  634.      
  635.      # The directory to install the info files in.
  636.      infodir = $(prefix)/info
  637.      
  638.      #### End of system configuration section. ####
  639.      
  640.      SRC1 =  tar.c create.c extract.c buffer.c \
  641.              getoldopt.c update.c gnu.c mangle.c
  642.      SRC2 =  version.c list.c names.c diffarch.c \
  643.              port.c wildmat.c getopt.c
  644.      SRC3 =  getopt1.c regex.c getdate.y
  645.      SRCS =  $(SRC1) $(SRC2) $(SRC3)
  646.      OBJ1 =  tar.o create.o extract.o buffer.o \
  647.              getoldopt.o update.o gnu.o mangle.o
  648.      OBJ2 =  version.o list.o names.o diffarch.o \
  649.              port.o wildmat.o getopt.o
  650.      OBJ3 =  getopt1.o regex.o getdate.o $(RTAPELIB)
  651.      OBJS =  $(OBJ1) $(OBJ2) $(OBJ3)
  652.      AUX =   README COPYING ChangeLog Makefile.in  \
  653.              makefile.pc configure configure.in \
  654.              tar.texinfo tar.info* texinfo.tex \
  655.              tar.h port.h open3.h getopt.h regex.h \
  656.              rmt.h rmt.c rtapelib.c alloca.c \
  657.              msd_dir.h msd_dir.c tcexparg.c \
  658.              level-0 level-1 backup-specs testpad.c
  659.      
  660.      all:    tar rmt tar.info
  661.      
  662.      tar:    $(OBJS)
  663.              $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  664.      
  665.      rmt:    rmt.c
  666.              $(CC) $(CFLAGS) $(LDFLAGS) -o $@ rmt.c
  667.      
  668.      tar.info: tar.texinfo
  669.              makeinfo tar.texinfo
  670.      
  671.      install: all
  672.              $(INSTALL) tar $(bindir)/$(binprefix)tar
  673.              -test ! -f rmt || $(INSTALL) rmt /etc/rmt
  674.              $(INSTALLDATA) $(srcdir)/tar.info* $(infodir)
  675.      
  676.      $(OBJS): tar.h port.h testpad.h
  677.      regex.o buffer.o tar.o: regex.h
  678.      # getdate.y has 8 shift/reduce conflicts.
  679.      
  680.      testpad.h: testpad
  681.              ./testpad
  682.      
  683.      testpad: testpad.o
  684.              $(CC) -o $@ testpad.o
  685.      
  686.      TAGS:   $(SRCS)
  687.              etags $(SRCS)
  688.      
  689.      clean:
  690.              rm -f *.o tar rmt testpad testpad.h core
  691.      
  692.      distclean: clean
  693.              rm -f TAGS Makefile config.status
  694.      
  695.      realclean: distclean
  696.              rm -f tar.info*
  697.      
  698.      shar: $(SRCS) $(AUX)
  699.              shar $(SRCS) $(AUX) | compress \
  700.                > tar-`sed -e '/version_string/!d' \
  701.                           -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  702.                           -e q
  703.                           version.c`.shar.Z
  704.      
  705.      dist: $(SRCS) $(AUX)
  706.              echo tar-`sed \
  707.                   -e '/version_string/!d' \
  708.                   -e 's/[^0-9.]*\([0-9.]*\).*/\1/' \
  709.                   -e q
  710.                   version.c` > .fname
  711.              -rm -rf `cat .fname`
  712.              mkdir `cat .fname`
  713.              ln $(SRCS) $(AUX) `cat .fname`
  714.              -rm -rf `cat .fname` .fname
  715.              tar chZf `cat .fname`.tar.Z `cat .fname`
  716.      
  717.      tar.zoo: $(SRCS) $(AUX)
  718.              -rm -rf tmp.dir
  719.              -mkdir tmp.dir
  720.              -rm tar.zoo
  721.              for X in $(SRCS) $(AUX) ; do \
  722.                  echo $$X ; \
  723.                  sed 's/$$/^M/' $$X \
  724.                  > tmp.dir/$$X ; done
  725.              cd tmp.dir ; zoo aM ../tar.zoo *
  726.              -rm -rf tmp.dir
  727.  
  728.